package com.meixiang.tool;

import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;

/**
 * 基金 动画工具类
 * Created by xyj on 2016/6/4.
 */
public class FundAnimationTool {

    public static Animation left_disAnimation;
    public static Animation left_showAnimation;
    public static Animation right_disAnimation;
    public static Animation right_showAnimation;

    /**
     * 初始化上下平移动画
     */
    public static void initAnimation(){
        left_showAnimation = new TranslateAnimation(1, 0.0F, 1, -1.0F, 1, 0.0F, 1, 0.0F);
        left_showAnimation.setDuration(500L);
        left_disAnimation = new TranslateAnimation(1, -1.0F, 1, 0.0F, 1, 0.0F, 1, 0.0F);
        left_disAnimation.setDuration(500L);
    }

    /**
     * 初始化右移动画
     */
    public static void initAniMation(float moveToCenter) {
        right_showAnimation = new TranslateAnimation(1, 0.0F, 2, -moveToCenter, 1, 0.0F, 1, 0.0F);
        right_showAnimation.setDuration(500L);
        right_disAnimation = new TranslateAnimation(2, -moveToCenter, 2, 0.0F, 1, 0.0F, 1, 0.0F);
        right_disAnimation.setDuration(500L);
    }

}
